<script setup>
import { RouterLink, RouterView } from 'vue-router'
</script>

<template>
  <header>
    <div class="navbar">
      <div class="logo">
        <span class="material-icons">favorite</span>
        <h1>健康管理系统</h1>
      </div>
      <nav>
        <RouterLink to="/">首页</RouterLink>
        <RouterLink to="/input">数据录入</RouterLink>
        <RouterLink to="/stats">数据统计</RouterLink>
        <RouterLink to="/goals">目标管理</RouterLink>
      </nav>
    </div>
  </header>

  <main>
    <RouterView />
  </main>
  
  <footer>
    <p>© 2025 个人健康管理系统 - Vue3前端项目</p>
  </footer>
</template>

<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: #f0f4f8;
  color: #333;
  line-height: 1.6;
}

header {
  background: linear-gradient(135deg, #3498db, #2c3e50);
  color: white;
  padding: 0 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo h1 {
  font-size: 24px;
  font-weight: 600;
}

nav {
  display: flex;
  gap: 25px;
}

nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 18px;
  font-weight: 500;
  padding: 8px 15px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.15);
}

nav a.router-link-active {
  color: white;
  background: rgba(255, 255, 255, 0.25);
}

main {
  min-height: calc(100vh - 150px);
  padding: 20px;
}

footer {
  background: #2c3e50;
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: 40px;
}

footer p {
  font-size: 14px;
  opacity: 0.8;
}

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 15px;
  }
  
  nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  nav a {
    font-size: 16px;
    padding: 6px 12px;
  }
}
</style>